<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Resultados</title>

<link rel="stylesheet" type="text/css"
	href="<%=request.getContextPath()%>/resources/css/bootstrap.css" />
</head>
<body>

	<div class="container-fluid">
		
		<ul class="breadcrumb">
		<li><a href="<%=request.getContextPath()%>">Home</a> <span class="divider">/</span></li>
		<li><a href="<%=request.getContextPath()%>/test">Prueba del Sistema</a> <span class="divider">/</span></li>
		<li class="active">Resultado</li>
		</ul>
	
		<c:if test="${success}">
			<div class="alert alert-success">
				<h3>El resultado de la prueba ha sido exitoso!</h3>
			</div>
		</c:if>
		
		<c:if test="${!success}">
			<div class="alert alert-error">
				<h3>El resultado de la prueba no ha sido exitoso</h3>
			</div>
		</c:if>
	
		<div>
			<table class="table table-striped">
				<thead>
					<tr>
						<th>#</th>
						<th>Resultado</th>
						<th>Entrada</th>
						<th>Salida Esperada</th>
						<th>Salida Entregada</th>	
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${testCasesResults}" var="testCaseResult">
						<tr>
							<td><c:out value="${testCaseResult.key + 1 }" /></td>
							<td><c:out value="${testCaseResult.value.result}" /></td>
							<td><c:out value="${testCaseResult.value.testCase.input}" /></td>
							<td><c:out value="${testCaseResult.value.testCase.output}" /></td>
							<td><c:out value="${testCaseResult.value.runningOutput}" /></td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
	
	
</body>
</html>